import request from '@/utils/request'

// 获取第一级分类的数据
export const reqCategory1List = () => request({ url: '/admin/product/getCategory1', method: 'get' })
// 获取第二级分类的数据
export const reqCategory2List = (id) => request({ url: `/admin/product/getCategory2/${id}`, method: 'get' })
// 获取第三级分类的数据
export const reqCategory3List = (id) => request({ url: `/admin/product/getCategory3/${id}`, method: 'get' })

// 获取属性值数据
export const reqAttrList = (category1Id, category2Id, category3Id) => request({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: 'get' })

// 添加新的属性名和属性值
export const addNewAttr = (data) => request({ url: `/admin/product/saveAttrInfo`, method: 'post', data })